{% load commenttags %}
{% load pp_url %}

<div class="inner"><b>Add Comment</b> | Add Pros | Add Cons | Add Context{% if object.child %} | Add {{ object.child|title }}{% endif %}</div>
    {% pp_comment_form POST=request.POST path=request.path user=user object=object%}
        <form id="pp_comment_form" method="post" action="">
            <div id="errors" class="errors">{{ pp_comment.errors }}</div>
                    <input type="hidden" name="form_id" value="pp_comment_form" id="id_form_id"/>
                    {{ pp_comment.form.text }}
                    {{ pp_comment.form.parent}}
                    {{pp_comment.form.form_id}}
                    {{csrf_string|safe}}
                {% if user.is_authenticated and user.is_active %}                                                            
                <input type="submit" class='button' value="Submit"><span style="color:grey;" id="submit_pp_comment_form"></span>
        </form>
                {% else %} 
                    <a class='button' href="{% pp_url template='register.html' %}">Submit</a>
                {% endif %}
<script>

  $("form#pp_comment_form").submit(function(e){
        $("#submit_pp_comment_form").html("<b>Submitting...</b>")
        addObject(e);
    });

</script>

        <span id="pp_comment_form_side_effect" style="display:none;">[{{pp_comment.object_pk}}, {{pp_comment.content_type}}]</span>

        {% endpp_comment_form %}

